import VueRouter from 'vue-router' //导入vueRouter
//  导入组件 
import home from './components/tab/home.vue'
import cart from './components/tab/cart.vue'
import find from './components/tab/find.vue'
import classes from './components/tab/classes.vue'
import user from './components/tab/user.vue'
import newslist from './components/news/newslist.vue'
import newsinfo from './components/news/newsinfo.vue'
import imagelist from './components/photo/imagelist.vue'
import imageinfo from './components/photo/imageinfo.vue'
import goodslist from './components/shop/goodslist.vue'
import goodsinfo from './components/shop/goodsinfo.vue'

//路由规则
var router = new VueRouter({
    
    routes:[
        {path:'/',redirect:'home'},
        {path:'/home',component:home},
        {path:'/classes',component:classes},
        {path:'/find',component:find},
        {path:'/cart',component:cart},
        {path:'/user',component:user},
        {path:'/home/newslist',component:newslist},
        {path:'/home/newsinfo/:id',component:newsinfo},
        {path:'/home/imagelist',component:imagelist},
        {path:'/home/imageinfo/:id',component:imageinfo},
        {path:'/home/goodslist',component:goodslist},
        {path:'/home/goodsinfo/:id',component:goodsinfo,name:'goodsinfo'} 
    ],
    linkActiveClass:'mui-active' //在当前路由添加类
})
export default router; //导出router